<?php

function smarty_modifier_avatar_url($avatar) {
	$path = 'resources/images/avatars/';
	if ($avatar == '' || empty($avatar)) {
		return $path . 'no-avatar.jpg';
	} elseif (!file_exists($path . $avatar)) {
		return $path . 'no-avatar.jpg';
	} else {
		return $path . $avatar;
	}
}

?>